import 'base_model.dart';

class UserScoreItemModel {
  int id;
  int userId;
  int gotNum;
  int remainNum;
  int gotMode;
  int status;
  String desc;
  int expireTime;
  int createdTime;
  int updatedTime;
  int subMod;

  UserScoreItemModel.fromJson(Map<String, dynamic> data) {
    id = data['id'];
    userId = data['user_id'];
    gotNum = data['got_num'];
    remainNum = data['remain_num'];
    gotMode = data['got_mode'];
    status = data['status'];
    desc = data['desc'];
    expireTime = data['expire_time'];
    createdTime = data['created_time'];
    updatedTime = data['updated_time'];
    subMod = data['sub_mod'];
  }
}

class UserScoreModel extends BaseModel {
  PagerModel pager;
  List<UserScoreItemModel> data = [];
  UserScoreModel.fromJson(Map<String, dynamic> res) : super.fromJson(res) {
    pager = PagerModel.fromJson(res["pager"] ?? {});
    List list = res["data"] ?? [];
    list.forEach((item) {
      data.add(UserScoreItemModel.fromJson(item));
    });
  }
  @override
  Map<String, dynamic> toJson() {
    return {'pager': pager, 'data': data};
  }
}
